const mongoose = require('mongoose')
//简单的关联
//type:mongoose.SchemaTypes.ObjectId,
//ref:'ArticleTotle'
const Schema = new mongoose.Schema({
    articleCategory:{
        type:mongoose.SchemaTypes.ObjectId,
        ref:'ArticleTitle'
    },
    title:{
        type:String,
        required:true
    },
    imageUrl:{
        type:String
    },
    content:{
        type:String,
        required:true
    },
    createTime:{
        type: Date, 
        default: Date.now
    }
})

module.exports = mongoose.model('Article',Schema)